home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 05 - 1989 / 05.06 Jun 89 / Supe SubCode / SuperSub.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-02-19  |  845 b   |  51 lines  |  [TEXT/MPS ]

  1. #include <QuickDraw.h>
  2. #include <Types.h>
  3. #include <Fonts.h>
  4. #include <Windows.h>
  5. #include <Menus.h>
  6. #include <TextEdit.h>
  7. #include <Dialogs.h>
  8. #include <Events.h>
  9. #include <Desk.h>
  10. #include <Files.h>
  11. #include <ToolUtils.h>
  12. #include <Controls.h>
  13. #include <strings.h>
  14.  
  15.  
  16. #include "traphook.h"
  17.  
  18.  
  19. extern TEHandle    TEH;
  20.  
  21. /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
  22.  
  23. DrawTextHook(cnt,pos,text)
  24.     int        cnt;
  25.     int        pos;
  26.     char        *text;
  27. {    
  28.     register int     fnt,offset;
  29.     GrafPtr             gptr;
  30.     
  31.     GetPort(&gptr);
  32.     fnt = gptr->txFont;
  33.     
  34.     offset = ((fnt & SUPER) ? -3 : ((fnt & SUB) ? 3 : 0));
  35.     
  36.     if (offset)
  37.     {    Move(0,offset);
  38.         TextFont(fnt & REGULAR);
  39.     }
  40.     
  41.     DrawText(text,pos,cnt);
  42.     
  43.     if (offset)
  44.     {    Move(0,-offset);
  45.         TextFont(fnt);
  46.     }
  47. }
  48.  
  49. /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
  50.  
  51.